<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // Promise 微任务
      Promise.resolve().then(() => {
        console.log('Promise 微任务');
      });

      // queueMicrotask 微任务
      queueMicrotask(() => {
        console.log('queueMicrotask 微任务');
      });

      // 同步任务
      console.log('同步任务');
    </script>
  </body>
</html>
